<%= grid(@notes, show_filters: :yes) do |g|
    g.action_column  object_property: :id
    # g.column name: 'ID', attribute: 'id' do |note|
    #   link_to note.id, note_path(note.id)
    # end
    g.column name: '用户', attribute: 'user_id' do |note|
     user_tag note.user
    end
    g.column name: '资源', attribute: 'controller'
    g.column name: '事件', attribute: 'action'
    g.column name: '目标', attribute: 'target_name' do |note|
        # if  note.action == 'destroy'
        #     note.target_name
        # else
        #     link_to note.target_name, "#{note.controller}/#{note.target_id}" if note.target_name
        # end
        note.target_name
    end
    g.column name: 'IP', attribute: 'ip'
    g.column name: '操作时间',attribute: 'created_at'  do |note|
      time_str note.created_at
    end
    g.column do |note|
      
    end
   
end %>
